<template>
    <div class="fullScreen bg-c-wh">
        <m-header :msg="'下级会员管理'"></m-header>
        <div class="tx-s-14 tx-c-222 pad-lr">
            <div class="flex-box flex-ac line-box bor-b-g" @click="openNext(2, 'B级代理列表')"> 
                <div class="wid-9">B级代理</div>
                <div>{{data.bms}}</div>
                <div class="arrow_right mar-l"></div>
            </div>
            <div class="flex-box flex-c line-box bor-b-g" @click="openNext(3, '会员列表')"> 
                <div class="wid-9">会员</div>
                <div>{{data.ms}}</div>
                <div class="arrow_right mar-l"></div>
            </div>
        </div>
    </div>
</template>
<script type="text/ecmascript-6">
import 'common/css/user.css'
import { mapGetters } from 'vuex'
import MHeader from '../../components/m-header'
import { isEmptyObject } from '../../common/js/common'
import { memberInfo } from '../../common/js/axiosUtil'
export default { 
    data() {
        return { 
            data : ''
        }
    },
    created () {
        this.getData()
    },
    methods: {
        // 打开会员列表页
        openNext (id, name) {
            this.$router.push({
                path: "/vipAgentList",
                query: {
                    id : id,
                    name : name
                }
            })
        },
        // 获取会员数量
        getData () {
            let params = this.$params(1)
            memberInfo(params)
            .then((response)=> { 
                if(response.data.code == "200"){
                    this.data = response.data.data
                } else {
                    this.$logAgain(response.data.msg)
                }
            })
            .catch((error)=> {
                this.$toast('请求服务失败', 2000)
            })
        }
    },
    components: {
        MHeader
    },
    computed: {
        ...mapGetters([
            'bfUserInfo'
        ])
    }
}
</script>
<style scoped lang="stylus" rel="stylesheet/stylus">
    .pad-lr
        padding: 0 1rem
    .line-box
        padding: 1rem 0
        background: white
    .wid-9
        width: 90%
    .mar-l
        margin-left: .5rem
</style>

